home *** CD-ROM | disk | FTP | other *** search
-
- //____________________________________________________________
- // PickInstruments.c
- //
- // Copyright © Dan Parks Sydow, 1995
- // From the book:
- // "Graphics and Sound Programming Techniques for the Mac",
- // M&T Books, 1995
-
-
- //____________________________________________________________
-
- #include <QuickTimeComponents.h>
-
-
- //____________________________________________________________
-
- void InitializeToolbox( void );
- void InitializeInstrument( void );
-
-
- //____________________________________________________________
-
- NoteAllocator gNoteAllocatorComp;
- ToneDescription gToneDesc;
-
-
- //____________________________________________________________
-
- void main( void )
- {
- ComponentResult theResult;
- Str31 thePrompt = "\pSelect an instrument:";
-
- InitializeToolbox();
-
- InitializeInstrument();
-
- theResult = NAPickInstrument( gNoteAllocatorComp, nil, thePrompt,
- &gToneDesc, 0, 0, 0, 0 );
- if ( theResult != noErr )
- ExitToShell();
- }
-
-
- //____________________________________________________________
-
- void InitializeInstrument( void )
- {
- gNoteAllocatorComp = OpenDefaultComponent( kNoteAllocatorType, 0 );
-
- gToneDesc.synthesizerType = 0;
- gToneDesc.synthesizerName[0] = 0;
- gToneDesc.instrumentName[0] = 0;
- gToneDesc.instrumentNumber = 0;
- gToneDesc.gmNumber = 0;
- }
-
-
- //____________________________________________________________
-
- void InitializeToolbox( void )
- {
- InitGraf( &qd.thePort );
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs( 0L );
- FlushEvents( everyEvent, 0 );
- InitCursor();
- }
-